#ifndef __APP_DBG_CMD_H__
#define __APP_DBG_CMD_H__

#include <rtthread.h>
#include "os_types.h"


#define DBG_CMD_FRAME_MIN_LEN      (7)        //协议最小固定长度
#define DBG_CMD_FRAME_RX_MAX_LEN   (2248)     //接收报文最大长度
#define DBG_CMD_FRAME_TX_MAX_LEN   (2048)     //发送报文最大长度
#define DBG_CMD_FRAME_HEAD         (0x55)     //帧头
#define DBG_CMD_FRAME_UP           (0x82)     //上行 PC->MCU 
#define DBG_CMD_FRAME_DN           (0x83)     //下行 MCU->PC


//命令
typedef enum
{
    DBG_CMD_CONN = 0x01,         //连接
    DBG_CMD_DISCONN = 0x02,      //断开连接
    DBG_CMD_ITEM = 0x03,         //检测/采集项
    DBG_CMD_SIG_INFO = 0xB0,     //单项信息

    DBG_CMD_PROC_SN = 0x0C,      //生产SN号
    DBG_CMD_MAINTAIN = 0x0D,     //维护
    DBG_CMD_ONESET = 0x0E,       //一键配置

    DBG_CMD_TEST = 0xCC,         //调试
    DBG_CMD_ERR = 0xEE,          //错误码  u16型
    DBG_CMD_HEART =0xE0,         //心跳包

    DBG_CMD_GET_INFO = 0xB1,     //获取信息
    DBG_CMD_SYNCTIME = 0xB2,     //同步时间
    DBG_CMD_UPDATE = 0xB3,       //更新固件    
    DBG_CMD_CA_OCPP = 0xB4,      //更新ocpp证书
    DBG_CMD_CA_15118 = 0xB5,     //更新15118证书
    DBG_CMD_FIR_15118 = 0xB6,    //升级15118固件
    DBG_CMD_RECOVERY = 0xB7,     //恢复出厂设置 
    DBG_CMD_REBOOT = 0xB8,       //重启

}dbg_cmd_e;


//通用数值
typedef enum
{
    DBG_VAL_NORMAL = 0x00,      //正常
    DBG_VAL_OVERTIME = 0x01,    //超时
    DBG_VAL_PASS = 0x02,        //通过
    DBG_VAL_FAIL = 0x03,        //失败
    DBG_VAL_DONE = 0x04,        //完成

}dbg_val_e;




extern void app_dbg_cmd_mp_analysis(UINT8 *pdata, UINT16 len);


#endif
